package ai.parser;

import static org.junit.Assert.*;

import java.text.ParseException;

import org.junit.Test;

public class TestImageParser {

	@Test
	public void testLoadImage() throws ParseException {
		ImageParser parser = new ImageParser("./Ressources/train-images");
		parser.open();
		
		double[] res = parser.loadImage();

		assertTrue(res.length == 784);
		assertTrue(res[0] == 0);
		assertTrue(res[239] == 182);
		assertTrue(res[240] == 247);
		assertTrue(res[res.length-1] == 0);
		
		res = parser.loadImage();
		
		assertTrue(res.length == 784);
		assertTrue(res[0] == 0);
		assertTrue(res[res.length-1] == 0);
		
		parser.close();
		
	}

}
